using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.Universal;

public class LightIntensityCurve:MonoBehaviour {

	[SerializeField] AnimationCurve intensityCurve;
	float timeAfterEnable;

	Light2D light;
	void Awake() { light=GetComponent<Light2D>(); }
	private void OnEnable() { timeAfterEnable=0; }

	void Update() {
		timeAfterEnable+=Time.deltaTime;
		light.intensity=intensityCurve.Evaluate(timeAfterEnable);
	}
}
